package kevin.framework.basic.common.utils;

import java.util.HashMap;
import java.util.Map;

/**
 * @Description: 用于封装动态数据源
 * @author kevin.huang
 * @date 2017年3月1日 下午2:44:02
 * @version v1.0.0
 */
public class DataSourceInfo {

	private String mybatisCfgClassPath = "classpath:/configHome/mybatis/mybatis.xml";
	private String mapperCfgClassPath = "classpath*:/configHome/mybatis/**/*-mapper.xml";

	public String getMybatisCfgClassPath() {
		return mybatisCfgClassPath;
	}

	public void setMybatisCfgClassPath(String mybatisCfgClassPath) {
		this.mybatisCfgClassPath = mybatisCfgClassPath;
	}

	public String getMapperCfgClassPath() {
		return mapperCfgClassPath;
	}

	public void setMapperCfgClassPath(String mapperCfgClassPath) {
		this.mapperCfgClassPath = mapperCfgClassPath;
	}

	private Map<String, Object> properties = new HashMap<String, Object>();


	
	public Map<String, Object> getProperties() {
		return properties;
	}

	public void setProperties(String key, Object value) {
		this.properties.put(key, value);
	}

	public Object getProperty(String key) {
		return this.properties.get(key);
	}

	
	private Map<String, Object> xaProps = new HashMap<String, Object>();
	
	public Map<String, Object> getxaProps() {
		return xaProps;
	}

	public void setxaProps(String key, Object value) {
		this.xaProps.put(key, value);
	}

	public Object getxaProps(String key) {
		return this.xaProps.get(key);
	}
	
	
	private int type;

	/**
	 * 连接类型 1=JNDI方式数据源 2=本地配置数据源
	 * 
	 * @return
	 */
	public int getType() {
		return type;
	}

	/**
	 * 连接类型 1=JNDI方式数据源 2=本地配置数据源
	 */
	public void setType(int type) {
		this.type = type;
	}

	private String id;
	private String dbName;

	public String getDbName() {
		return dbName;
	}

	public void setDbName(String dbName) {
		this.dbName = dbName;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	
	String driverClass;
	String url;
	String username;
	String password;
	
	
	public String getDriverClass() {
		return driverClass;
	}

	public void setDriverClass(String driverClass) {
		this.driverClass = driverClass;
	}

	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	@Override
	public String toString() {
		return "dbName=" + dbName + ";id=" + id;
	}

}
